// hatBox.cpp : implementation file
//

#include "stdafx.h"
#include "firstClient.h"
#include "hatBox.h"


// chatBox dialog

IMPLEMENT_DYNAMIC(chatBox, CDialog)


BEGIN_MESSAGE_MAP(chatBox, CDialog)
END_MESSAGE_MAP()

chatBox::chatBox(CWnd* pParent /*=NULL*/)
	: CDialog(chatBox::IDD, pParent)
{
	m_isReceived = false;
}

chatBox::~chatBox()
{
}

void chatBox::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_BuddyList, m_conversationBx);
}

void chatBox::receiveMsg(BSTR* user, BSTR* msg)
{
		m_isReceived = true;
		CFont fnt;
		int length = m_conversationBx.GetWindowTextLengthW();
		m_conversationBx.SetSel(length,length);
		m_conversationBx.ReplaceSel((CString)(*msg));
}

// chatBox message handlers
